#include <stdio.h>
#include "dlist.h"

int main() {
    dlist_t *list = new_dlist_node(2);
    int i = 0;

    for(i = 0; i < 7; i++){
        list = dlist_add(list, 3 + i);
    }
    printf("打印未处理过的完整链表\n");
    dlist_print(list);

    list = dlist_delete(list, 0);  //删除第一个结点
    list = dlist_delete(list, 3);  //删除第四个结点
    printf("打印删除2个结点后的链表\n");
    dlist_print(list);

    dlist_t *node = dlist_index_of(list, 2);
    printf("第3个结点是：%d\n", node->data);

    printf("销毁链表\n");
    dlist_destroy(list);
    list = NULL;

    return 0;
}
